<!doctype html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<html>
<head>
    <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    %>
    <%@ include file="/WEB-INF/views-jsp/include/taglib/taglib.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/meta/meta.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/link/link.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/script/script.jsp" %>
    <script>
        var source = "${source}";
    </script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/common/select-plugin.js"></script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/common.js"></script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/me/craneProject/craneProjectOption.js?v=<%out.print(Math.random());%>"></script>
</head>
<body>
<div class="place">
    <span>当前位置：</span>
    <ul class="placeul">
        <c:if test="${source == null}">
	        <li><a href="${path}/craneProject/index.do">起重机械配置</a></li>
        </c:if>
        <c:if test="${source != null && source == 'deviceManage'}">
	        <li><a href="${path}/device/index.do">设备管理</a></li>
        </c:if>
        <c:if test="${craneProject.cpId == null}">
            <li><a>添加起重机械配置</a></li>
        </c:if>
        <c:if test="${craneProject.cpId != null}">
            <li><a>修改起重机械配置</a></li>
        </c:if>
    </ul>
</div>
<form id="operate_form" class="form" method="post" action="#">
    <div class="formbody">
        <div class="formtitle"><span>基本信息</span></div>
        <table id="craneProjectDesc" align="center" border="0" width="100%">
            <tr><input type="hidden" name="cpId" id="cpId" value="${craneProject.cpId}" /></tr>
            <tr>
                <td align="right">起重器械名称/设备名称：</td>
                <td align="left"><input class="easyui-textbox" name="cpName" id="cpName" value="${craneProject.cpName}"
                                        style="width:255px; height: 30px" data-options="validType:'length[1,18]',prompt:'请输入起重器械名称/设备名称'"/></td>
                <td align="right">起重器械序列号/设备编号：</td>
                <td align="left"><input class="easyui-textbox" name="cpCode" id="cpCode" value="${craneProject.cpCode}"
                                        style="width:255px; height: 30px" data-options="validType:'length[1,18]',prompt:'请输入起重器械序列号/设备编号'"/></td>
            </tr>
            <tr>
                <td align="right">设备IP与端口：</td>
                <td align="left"><input class="easyui-textbox" name="meIpPortInfo" id="meIpPortInfo" data-options="validType:'length[1,18]',prompt:'请输入设备IP与端口'"
                                        style="width:255px; height: 30px" value="${craneProject.meIpPortInfo}"/></td>
                <td align="right">设备状态：</td>
                <td align="left"><select class="select-commonDict" data-modelCode="ME" data-funCode="meStatus"
                                         name="meStatus" id="meStatus" defualt-value="${craneProject.meStatus}"
                                         style="width:255px; height: 32px" editable="false"></select></td>
            </tr>
            <tr>
                <td align="right">在线状态：</td>
                <td align="left"><select class="select-commonDict" data-modelCode="ME" data-funCode="onLineStatus"
                                         name="onLineStatus" id="onLineStatus" defualt-value="${craneProject.onLineStatus}"
                                         style="width:255px; height: 32px" editable="false"></select></td>
                <td align="right">设备序列号：</td>
                <td align="left"><input class="easyui-textbox" name="deviceId" id="deviceId" data-options="required:true,validType:'length[1,18]',prompt:'请输入设备序列号'" missingMessage="设备序列号不能为空"
                                        style="width:255px; height: 30px" value="${craneProject.deviceId}"/></td>
            </tr>
            <tr>
                <td align="right">布点位置：</td>
                <td align="left">
                    <input class="easyui-textbox" data-options="validType:'length[1,18]',prompt:'请输入布点位置'" name="distributLoc" id="distributLoc" style="width:255px; height: 30px"  value="${craneProject.distributLoc}"/>
                </td>
                <td align="right">所属公司：</td>
                <td align="left">
                    <input type="hidden" name="companyId" id="companyId" value="${null == craneProject ? DefaulCompany : craneProject.project.companyId}">
                    <input type="hidden" id="oldCompanyId" value="${null == craneProject ? DefaulCompany : craneProject.project.companyId}">
                    <input class="easyui-combotree" editable="false" data-options="required:true,prompt:'请输入所属公司'" missingMessage="所属公司不能为空" id="companyTree" style="width:255px; height: 32px" >
                    </input>
                </td>
            </tr>
            <tr>
                <td align="right">所属项目部：</td>
                <td align="left">
                    <input type="hidden" name="officeId" id="officeId"  value="${craneProject.project.officeId}">
                    <input type="hidden" id="oldOfficeId"  value="${craneProject.project.officeId}">
                    <input class="easyui-combotree" editable="false" data-options="prompt:'请输入部门'"  id="officeTree" style="width:255px; height: 32px" >
                    </input>
                </td>
                <td align="right">所属项目：</td>
                <td align="left">
                    <input type="hidden" name="prId" id="prId_"  value="${craneProject.project.prId}">
                    <input type="hidden" id="oldPrId"  value="${craneProject.project.prId}">
                    <select class="easyui-combobox" id="projectList" style="width:255px; height: 32px" validType="selectNotEmpty['所属项目']" editable="false">
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">使用性质：</td>
                <td align="left"><select class="select-commonDict" data-modelCode="ME" data-funCode="cpUseType"
                                         name="cpUseType"
                                         id="cpUseType" style="width:255px; height: 32px"  defualt-value="${craneProject.cpUseType}" editable="false"></select></td>
                <td align="right">起重器械所属的标准配置：</td>
                <td align="left">
                    <input type="hidden" name="csId_" id="csId_" value="${craneProject.craneStandard.csId}" />
                    <select class="easyui-combobox" name="csId" id="csId" style="width:255px; height: 32px" editable="false"></select>
                </td>
            </tr>
            <tr>
                <td align="right">产权单位：</td>
                <td align="left"><input class="easyui-textbox" name="propertyUnit" id="propertyUnit" data-options="validType:'length[1,18]', prompt:'请输入产权单位'"
                                        style="width:255px; height: 30px" value="${craneProject.propertyUnit}" /></td>
                <td align="right">负责人：</td>
                <td align="left"><input class="easyui-textbox" name="principal" id="principal" style="width:255px; height: 30px" data-options="validType:['length[1,5]','name'],prompt:'请输入负责人'"  value="${craneProject.principal}"/>
                </td>
            </tr>
            <tr>
                <td align="right">负责人电话：</td>
                <td align="left"><input class="easyui-textbox" data-options="prompt:'请输入负责人电话'" name="principalTel" id="principalTel" style="width:255px; height: 30px" validType="mobile"  value="${craneProject.principalTel}"/>
                </td>
                <td align="right">出厂编号：</td>
                <td align="left"><input class="easyui-textbox" data-options="validType:'length[1,18]',prompt:'请输入出厂编号'" name="factoryNum" id="factoryNum" style="width:255px; height: 30px"   value="${craneProject.factoryNum}"/>
                </td>
            </tr>
            <tr>
                <td align="right">监检证书编号：</td>
                <td align="left"><input class="easyui-textbox" data-options="validType:'length[1,18]',prompt:'请输入监检证书编号'" name="supervisedCertNum" id="supervisedCertNum" value="${craneProject.supervisedCertNum}"
                                        style="width:255px; height: 30px" /></td>
                <td align="right">出厂日期：</td>
                <td align="left">
                        <input id="manufactureDate"  style="width:255px; height: 32px"	class="easyui-datebox" name="manufactureDate" data-options="prompt:'请选择出厂日期',editable:false,onSelect:onSelect" value="<fmt:formatDate value="${craneProject.manufactureDate}" pattern="yyyy-MM-dd"/>" >
                </td>
            </tr>
            <tr>
                <td align="right">购置日期：</td>
                <td align="left">
                    <input id="purchaseDate" style="width:255px; height: 32px"	class="easyui-datebox" name="purchaseDate"   data-options="prompt:'请选择购置日期',editable:false,validType:'equaldTime[\'#manufactureDate\']'" value="<fmt:formatDate value="${craneProject.purchaseDate}" pattern="yyyy-MM-dd"/>" >
                </td>
                <td align="right">生产厂家：</td>
                <td align="left"><input class="easyui-textbox" data-options="validType:'length[1,18]',prompt:'请输入生产厂家'"  name="manufacturer" id="manufacturer" value="${craneProject.manufacturer}"
                                        style="width:255px; height: 30px"/></td>
            </tr>
            <tr>
                <td align="right">制造许可证编号：</td>
                <td align="left">
                    <input class="easyui-textbox" data-options="validType:'length[1,18]',prompt:'请输入制造许可证编号'" name="manuLicenceNum" id="manuLicenceNum" style="width:255px; height: 30px"  value="${craneProject.manuLicenceNum}"/>
                </td>
                <td align="right">产权备案号：</td>
                <td align="left"><input class="easyui-textbox" name="propRecordNum" id="propRecordNum" data-options="validType:'length[1,18]',prompt:'请输入产权备案号'"
                                        style="width:255px; height: 30px" value="${craneProject.propRecordNum}"></td>
            </tr>
            <tr>
                <td align="right">布点经度：</td>
                <td align="left"><input class="easyui-numberbox"  name="longitude" id="longitude" data-options="min:-180,precision:4,max:180,prompt:'请输入布点经度'"
                                        style="width:255px; height: 30px" value="${craneProject.longitude}" validType="longitude" /></td>
                <td align="right">布点纬度：</td>
                <td align="left"><input class="easyui-numberbox"  name="latitude" id="latitude" data-options="min:-90,precision:4,max:90,prompt:'请输入布点纬度'"
                                        style="width:255px; height: 30px" value="${craneProject.latitude}" validType="latitude"/></td>
            </tr>

            <tr>
                <td align="right" valign="top">备注：</td>
                <td align="left" valign="top"><input class="easyui-textbox" name="remark" id="remark"  data-options="multiline:true,validType:'length[1,30]',prompt:'请输入备注'"
                                        style="width:255px; height: 100px"  value="${craneProject.remark}"/></td>
            </tr>
            <tr align="center">
                <td colspan="4">
                    <div>
                        <a id="optionCraneProject" class="easyui-linkbutton c1" style="width:120px; height: 35px">保存</a>
                        &nbsp;&nbsp;&nbsp;
                        <c:if test="${source == null}">
                            <a href="${path}/craneProject/index.do" class="easyui-linkbutton c1" style="width:120px; height: 35px">取消</a>
                        </c:if>
                        <c:if test="${source != null && source == 'deviceManage'}">
                            <a href="${path}/device/index.do" class="easyui-linkbutton c1" style="width:120px; height: 35px">取消</a>
                        </c:if>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</form>
</body>
</html>